<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>报案信息</title>
        <meta name="renderer" content="webkit">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
   	    <link rel="stylesheet" href="./css/font.css">
   	    <link rel="stylesheet" href="./css/xadmin.css">
        <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="./js/xadmin.js"></script>
   			
   			
	   
   			
    </head>
    <body class="layui-anim layui-anim-up">
    	

    <div class="x-body">
      <div class="layui-row">
        
          <select style="width: 200px;">
            <option value="1" selected="selected" >报案成功</option>
          	<option value="2">上传车辆</option>
          	<option value="3">上传证件</option>
          	<option value="4">上传审核失败</option>
          	<option value="5">上传审核成功</option>
          	<option value="6">已定损，未确认</option>
          	<option value="7">定损已确认</option>
          	<option value="8">理赔中</option>
          	<option value="9">已转账</option>
          	<option value="10" >确认收钱</option>
          </select>
        
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        	
      
       	
      </div>
      
     
  
     
        <span class="x-right" style="line-height:40px" id ="count" >共有数据：8 条</span>
  	 
  	 
  	 <table class="layui-table"  id="table222">
        <thead>
          <tr>
          
            <th>报案号</th>
            <th>保单号</th>
            <th>报案人</th>
            
            <th>查勘人</th>
            <th>报案时间</th>
            <th>报案状态</th>
            
            <th>操作</th>
        </thead>
        <tbody>
         
        </tbody>
      </table>
      
      <div class="page">
        <div>
        <a class="no1">首页</a>
          <a class="first">上一页</a>
          <!-- <span class="current" >1</span>
          <a class="num">2</a>
          <a class="num">3</a> -->
          <a class="layout" ></a>
          <a class="next" >下一页</a>
          <a class="last">末页</a>
        </div>
      </div>
    </div>
    
 <script>
	 $(function(){
			//初始化值
			init(1);
		});
	//转换时间
 	function add0(m){return m<10?'0'+m:m }
 	//时间戳转化成时间格式
 	function timeFormat(timestamp){
 	  //timestamp是整数，否则要parseInt转换,不会出现少个0的情况
 	    var time = new Date(timestamp);
 	    var year = time.getFullYear();
 	    var month = time.getMonth()+1;
 	    var date = time.getDate();
 	    var hours = time.getHours();
 	    var minutes = time.getMinutes();
 	    var seconds = time.getSeconds();
 	    return year+'-'+add0(month)+'-'+add0(date)+' '+add0(hours)+':'+add0(minutes)+':'+add0(seconds);
 	}
 	//
 //初始化从后台调用数据 传入的参数是第几页
    	function init(pageNo){
    		$.getJSON(
    				"baoanlist.do",
    				{"pageNo":pageNo},
    				function (page){
    					//1.  删除  所有的  过时数据 ： 除去第一个 和 最后一个  所有  tr	
    					$("table tr:not(:first)").remove();
    					
    					$(page.list).each(function(index,obj){
    					    //$("table tr:not(:first)").not(":last").remove();
    						//将数据 写道到  创建tr 中 
    						var tr ="<tr>"
    							
    							+"<td>"+obj.reportNo+"</td>"
    							+"<td>"+obj.insuranceId+"</td>"
    							+"<td>"+obj.reportName+"</td>"
    							
    							+"<td>"+surveyorsName+"</td>"
    							+"<td>"+timeFormat(obj.reportTime)+"</td>"
    							
    							+"<td>"+obj.loadName+"</td>"
    							+"<td class='td-manage'>"
    							+"<button class='layui-btn layui-btn layui-btn-xs'  onclick=\"x_admin_show('编辑','audit_return_b.html?reportNo="+obj.reportNo+"')\">"
    							+"<i class='layui-icon'>&#xe642;</i>详情</button></td>"
    							+"</tr>";
    								
    							$("tbody").append(tr);
    						
    					});//循环
    						//最后一个数据加上小红点
    						//$("tbody>tr:last-child td:first-child").prepend("<span class='layui-badge-dot'></span>");
    						
    					//分页
    					$("#count").html("共有数据："+page.total+"条");
    					$(".layout").html(page.pageNum+"/"+page.pages);
    					if(pageNo==1){
    						$(".no1").removeAttr('href');
        					$(".first").removeAttr('href');
    					}else{
    						$(".no1").attr("href","javascript:init(1)");
    						$(".first").attr("href","javascript:init("+(pageNo-1)+")");
    					}
    					if(pageNo==page.pages){

    						$(".last").removeAttr('href');
    						$(".next").removeAttr('href');
    					}else{
    						$(".last").attr("href","javascript:init("+(page.pages)+")");
        					$(".next").attr("href","javascript:init("+(pageNo+1)+")");
    					}
    					
    				}//回调函数方法
    		
    		);//ajax方法
    		
    	};
    	
    	
    	
    	
 		//打印数据
		 var loginForm = document.getElementById('form_getExcel');
		 function beforeSubmit() {
		     loginForm.submit();
		 }
		 //
		 
		 
 </script>
   
  </body>

</html>